package org.nf.product.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.nf.db.util.Column;

import java.time.LocalDateTime;

/**
 * 产品实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Product {
    /**
     * 产品编号
     */
    @Column("product_id")
    private int productId;

    /**
     * 产品名称
     */
    @Column("product_name")
    private String productName;

    /**
     * 产品价钱
     */
    @Column("product_price")
    private float productPrice;

    /**
     * 产品详情、介绍
     */
    @Column("product_details")
    private String productDetails;

    /**
     * 上架日期
     */

    @Column("product_date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)

    private LocalDateTime productDate;

    /**
     * 产品类型编号
     */
    @Column("type_id")
    private String type_id;

    /**
     * 图片 全景
     */
    @Column("product_image")
    private String productImage;

    /**
     * 面积
     */
    @Column("product_area")
    private String productArea;

    /**
     * 设计师姓名
     */
    @Column("stylist_name")
    private String stylistName;

    /**
     * 销量统计
     */
    @Column("product_sales")
    private int productSales;





}
